
TARGETS_GD32 := \
	GD32TEST

HAL_FOLDER_GD32 := $(HAL_FOLDER)/f350

MCU_GD32 := -mcpu=cortex-m4 -mthumb
LDSCRIPT_GD32 := $(HAL_FOLDER_GD32)/STM32F302CBTX_FLASH.ld

SRC_DIR_GD32 := \
	$(HAL_FOLDER_GD32)/Startup \
	$(HAL_FOLDER_GD32)/Src \
	$(HAL_FOLDER_GD32)/Drivers/STM32F3xx_HAL_Driver/Src

CFLAGS_GD32 += \
	-I$(HAL_FOLDER_GD32)/Inc \
	-I$(HAL_FOLDER_GD32)/Drivers/STM32F3xx_HAL_Driver/Inc \
	-I$(HAL_FOLDER_GD32)/Drivers/CMSIS/Include \
	-I$(HAL_FOLDER_GD32)/Drivers/CMSIS/Device/ST/STM32F3xx/Include

CFLAGS_GD32 += \
	-DHSE_VALUE=8000000 \
	-DSTM32F302xC \
	-DHSE_STARTUP_TIMEOUT=100 \
	-DLSE_STARTUP_TIMEOUT=5000 \
	-DLSE_VALUE=32768 \
	-DVDD_VALUE=3300 \
	-DLSI_VALUE=32000 \
	-DHSI_VALUE=8000000 \
	-DUSE_FULL_LL_DRIVER \
	-DPREFETCH_ENABLE=1

SRC_GD32 := $(foreach dir,$(SRC_DIR_GD32),$(wildcard $(dir)/*.[cs]))
